<?php
/**
 * @Author: Xu Liu email:2867557054@qq.com
 * @Date:   2016-12-15 13:31:33
 * @Last Modified by:   Xu Liu
 * @Last Modified time: 2017-06-10 18:34:33
 */
if (!defined('IN_ADMINCP') || !defined('IN_DISCUZ')) {
    exit('Access Denied');
}
class MseoContrl
{
    public function index()
    {
        global $_G;
        $seo = C::t('common_setting')->fetch_all(array(
            'xf512seo_index',
            'xf512seo_book',
            'xf512seo_read',
            'xf512seo_cate',
            'xf512seo_shaixuan',
        ));
        include template('jameson_read:mseo_index');
    }
    public function post()
    {
        global $_G;
        if (submitcheck('editsubmit')) {
            C::t('common_setting')->update('xf512seo_index',daddslashes($_GET['seoindex']));
            C::t('common_setting')->update('xf512seo_book',daddslashes($_GET['seobook']));
            C::t('common_setting')->update('xf512seo_read',daddslashes($_GET['seoread']));
            C::t('common_setting')->update('xf512seo_cate',daddslashes($_GET['seocate']));
            C::t('common_setting')->update('xf512seo_shaixuan',daddslashes($_GET['seoshaixuan']));
            cpmsg(lang('plugin/jameson_read', 'gengxinchenggong'), 'action=plugins&operation=config&do=' . $_GET['do'] . '&identifier=jameson_read&pmod=jameson_read&contrl=mseo&act=index', 'succeed');
        } else {
            cpmsg(lang('plugin/jameson_read', 'laiyuanfeifa'), 'action=plugins&operation=config&do=' . $_GET['do'] . '&identifier=jameson_read&pmod=jameson_read&contrl=mseo&act=index', 'error');
        }
    }
}